package com.budwk.app.sqfwV2.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum RedWhiteEnum {
    A(1,"婚事办理酒席备案","sqfwV2/patrolAndVisit/xcjl.docx","婚事办理酒席备案表","sqfwV2/patrolAndVisit/templet/宣传记录表.docx","/preview/pat/2.png"),
    B(2,"丧事办理酒席备案","sqfwV2/patrolAndVisit/pcjl.docx","丧事办理酒席备案表","sqfwV2/patrolAndVisit/templet/排查记录表.docx","/preview/pat/3.png"),
    C(3,"云岩区自办酒席情况统计","sqfwV2/patrolAndVisit/jdgz.xlsx","云岩区自办酒席情况统计表","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.png"),
    D(4,"大营路街道“治风”工作推进","sqfwV2/patrolAndVisit/jdgz.xlsx","大营路街道“治风”工作推进表","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.png"),
    E(5,"表九：区（市、县）信息互通统计","sqfwV2/patrolAndVisit/jdgz.xlsx","表九：区（市、县）信息互通统计表","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.png"),
    F(6,"云岩区红事跟踪报备","sqfwV2/patrolAndVisit/jdgz.xlsx","云岩区红事跟踪报备月台账","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.png"),
    G(7,"云岩区白事跟踪报备","sqfwV2/patrolAndVisit/jdgz.xlsx","云岩区白事跟踪报备月台账","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.png"),
    ;
    private  int code;
    private  String name;
    private  String templat;
    private  String fileName;
    private  String blankTemplate;
    private  String previewImage;



    public static String getFileName(String name){
        String filename = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e -> name .equals(e.getName()) )
                .collect(Collectors.toList())
                .get(0)
                .getFileName();
        return filename;
    }

    public static String getBlankTemplate(Integer code){
        String blankTemplate = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getBlankTemplate();
        return blankTemplate;
    }
    public static String getName(Integer code){
        String name = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getName();
        return name;
    }

    public static String getPdfTemplatName(String name){
        String templat = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e -> name .equals(e.getName()) )
                .collect(Collectors.toList())
                .get(0)
                .getTemplat();
        return templat;
    }

    public static String getPdfTemplat(Integer code){
        String templat = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e ->  code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getTemplat();
        return templat;
    }
    public static String getFileName(Integer code){
        String fileName = Arrays.asList(RedWhiteEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getFileName();
        return fileName;
    }

}
